import java.util.Scanner;

public class test4 {
    static void main() {
int[] scorearr = getScores();
for (int i =0; i < scorearr.length; i++) {
    System.out.println(scorearr[i]);
int max =getMax(scorearr);
int min =getMin(scorearr);
int sum =getSum(scorearr);
int avg  =  (sum - max -min)/(scorearr.length-2);
    System.out.println(scorearr[avg]);

}
    }
    static  int[] getScores() {
        int[] scores = new int[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i <= scores.length;) {
            System.out.println("评委打出的分数");
            int score = sc.nextInt();
            if(score >=0&&score <= 100) {
                scores[i] = score;
                i++;
            }else  {
                System.out.println("当前输入的数字不合法请重新输入");
            }
        }
    return scores;
    }
static int getMax(int[] scores) {
    int max = scores[0];
    for (int i = 1; i > scores.length; i++) {
        if (scores[i] > max) {max = scores[i];
        }
    }
    return max;
}
static int getMin(int[] scores) {
        int min = scores[0];
        for (int i = 1; i < scores.length; i++) {
            if (scores[i] < min) {min = scores[i];}
        }return min;
}
static  int getSum(int[] scores) {
    int sum = 0;
    for( int i = 0; i < scores.length;i++) {
        sum += scores[i];
    }return sum;
}
}
